﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommandLib
{
    public sealed class Config
    {
        private const string KeyUrlImage = "UrlImage";
        private const string KeyFolderImage = "FolderImage";
        private const string KeyFolderImageSlideShow = "FolderImageSlideShow";
        private const string KeyFolderImageWhatWeDo = "FolderImageWhatWeDo";
        private const string KeyFolderImageLastProject = "FolderImageLastProject";
        private const string KeyFolderImageArtWork = "FolderImageArtWork";

        private const string KeyOnePayVitualPaymentClientURL = "OnePayVitualPaymentClientURL";
        private const string KeyOnePayUrlReturn = "OnePayUrlReturn";
        private const string KeyOnePaySecretKey = "OnePaySecretKey";
        private const string KeyOnePayAccessCode = "OnePayAccessCode";
        private const string KeyOnePayMerchantId = "OnePayMerchantId";

        private string _urlImage { get; set; }
        private string _folderImage { get; set; }
        private string _folderImageSlideShow { get; set; }
        private string _folderImageWhatWeDo { get; set; }
        private string _folderImageLastProject { get; set; }
        private string _folderImageArtWork { get; set; }

        private string _onePayVitualPaymentClientURL { get; set; }
        private string _onePayUrlReturn { get; set; }
        private string _onePaySecretKey { get; set; }
        private string _onePayAccessCode { get; set; }
        private string _onePayMerchantId { get; set; }

        public static string UrlImage { get { return Instance._urlImage; } }
        public static string FolderImage { get { return Instance._folderImage; } }
        public static string FolderImageSlideShow { get { return Instance._folderImageSlideShow; } }
        public static string FolderImageWhatWeDo { get { return Instance._folderImageWhatWeDo; } }
        public static string FolderImageLastProject { get { return Instance._folderImageLastProject; } }
        public static string FolderImageArtWork { get { return Instance._folderImageArtWork; } }

        public static string OnePayVitualPaymentClientURL { get { return Instance._onePayVitualPaymentClientURL; } }
        public static string OnePayUrlReturn { get { return Instance._onePayUrlReturn; } }
        public static string OnePaySecretKey { get { return Instance._onePaySecretKey; } }
        public static string OnePayAccessCode { get { return Instance._onePayAccessCode; } }
        public static string OnePayMerchantId { get { return Instance._onePayMerchantId; } }

        private static readonly Config Instance = new Config();        

        public Config()
        {
            _urlImage = ConfigSection.GetAppSetting(KeyUrlImage);
            _folderImage = ConfigSection.GetAppSetting(KeyFolderImage);
            _folderImageSlideShow = ConfigSection.GetAppSetting(KeyFolderImageSlideShow);
            _folderImageWhatWeDo = ConfigSection.GetAppSetting(KeyFolderImageWhatWeDo);
            _folderImageLastProject = ConfigSection.GetAppSetting(KeyFolderImageLastProject);
            _folderImageArtWork = ConfigSection.GetAppSetting(KeyFolderImageArtWork);

            _onePayVitualPaymentClientURL = ConfigSection.GetAppSetting(KeyOnePayVitualPaymentClientURL);
            _onePayUrlReturn = ConfigSection.GetAppSetting(KeyOnePayUrlReturn);
            _onePaySecretKey = ConfigSection.GetAppSetting(KeyOnePaySecretKey);
            _onePayAccessCode = ConfigSection.GetAppSetting(KeyOnePayAccessCode);
            _onePayMerchantId = ConfigSection.GetAppSetting(KeyOnePayMerchantId);
        }
    }
}
